use std::sync::RwLock;
use rustful::{Context, Response};
use json;
use mysql;
use mysql::Pool;

pub fn empty_method(context: Context, response: Response){}

pub fn service_version(context: Context, response: Response){
    let message = json!({"version": "v1.0"});
    response.send(message.to_string());
}

pub fn say_hello(context: Context, response: Response) {
    //Get the value of the path variable `:person`, from below.
    let person = match context.variables.get("name") {
        Some(name) => name,
        None => "stranger".into()
    };

    //Use the name from the path variable to say hello.
    response.send(format!("Hello, {}!", person));
}

pub fn user_login(context: Context, response: Response) {
    //Use the name from the path variable to say hello.
    response.send(format!("Hello, {}!", "login"));
}

